#include <cmath>

#include "common.h"

robot::SpeedInfo robot::speeds[nspeeds] = {
	{ 0,		0 },
	{ 1.0/40.0,	0 },
	{ 1.0/20.0,	1 },
	{ 1.0/15.0,	1 },
	{ 1.0/10.0,	2 },
	{ 1.0/8.0,	3 },
	{ 1.0/6.0,	5 },
	{ 1.0/4.0,	7 },
	{ 1.0/3.0,	9 },
	{ 1.0/2.0,	12 },
	{ 1.0,		20 }
};

double robot::polar_angle(double y, double x) {
	return atan2(y, x) + (x < 0.0) ? M_PI : 0.0;
}
